<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Document</title>
  <meta name="viewport" content="
    width=device-width,
    initial-scale=0.5,
    user-scalable=no,
    viewport-fit=cover">
</head>

<body>
  <div class="msg1">
    Hello World(vw)
  </div>
  <style>
    .msg1 {
      font-size: 18px;
      width: 100vw;
      background-color: red;
    }
  </style>
  <script>
    (function (window, document) {
      const viewport = document.querySelector("meta[name=viewport]");
      const pixelRatio = window.devicePixelRatio;
      const scale = 1 / pixelRatio;
      viewport.setAttribute('content', `width=device-width,initial-scale=${scale}, maximum-scale=${scale}, minimum-scale=${scale}, user-scalable=no`);
    }(window, document))
  </script>
</body>

</html>